import request from './request'

// 获取视频列表
export function getVideoList(params) {
    return request({
        url: '/admin/video/list',
        method: 'get',
        params
    })
}

// 获取视频详情
export function getVideoDetail(id) {
    return request({
        url: `/admin/video/${id}`,
        method: 'get'
    })
}

// 创建视频
export function createVideo(data) {
    return request({
        url: '/admin/video',
        method: 'post',
        data
    })
}

// 更新视频
export function updateVideo(id, data) {
    return request({
        url: `/admin/video/${id}`,
        method: 'put',
        data
    })
}

// 删除视频
export function deleteVideo(id) {
    return request({
        url: `/admin/video/${id}`,
        method: 'delete'
    })
}

// 上传视频
export function uploadVideo(formData) {
    return request({
        url: '/admin/video/upload',
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
} 